home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / bbsutil / hsrc_117.zip / FNDFAREA.C < prev    next >
Text File  |  1990-09-01  |  1KB  |  45 lines

  1. #include "msgg.h"
  2. #include "twindow.h"
  3. #include "keys.h"
  4. #include "headedit.h"
  5.  
  6. word pascal find_filearea (void) {
  7.  
  8.     int handle;
  9.     char s[256];
  10.     char *p;
  11.     struct _fboard fboard;
  12.  
  13.     if(!flsearch) {
  14.         error_message(" FLSEARCH not defined ");
  15.         nopause();
  16.         return 0;
  17.     }
  18.     if ((handle=_open(flsearch,O_RDONLY | O_TEXT | O_DENYNONE))==-1) {
  19.         error_message(" Can't open flsearch file ");
  20.         nopause();
  21.         return 0;
  22.     }
  23.     while (!eof(handle)) {
  24.         if (!fgetsx(s,256,handle)) break;
  25.         if (*s=='\n' || *s=='\r' || *s==';') continue;
  26.         stripcr(s);
  27.         strncpy(fboard.dpath,strtok(s," "),79);
  28.         fboard.dpath[78]=0;
  29.         if (fboard.dpath[strlen(fboard.dpath)-1]!='\\') strcat(fboard.dpath,"\\");
  30.         strtok(0," ");
  31.         strncpy(fboard.name,strtok(0," "),47);
  32.         fboard.name[46]=0;
  33.         while((p=strchr(fboard.name,'_'))!=NULL) *p=' ';
  34.         if (!stricmp(fboard.name,currarea->name)) break;
  35.     }
  36.     if (eof(handle)) {
  37.         _close(handle);
  38.         return 0;
  39.     }
  40.     _close(handle);
  41.     strcpy(filepath,fboard.dpath);
  42.     return 1;
  43. }
  44.  
  45.